package com.apes.auto.maintain.model;

import com.apes.auto.car.model.CarBrand;
import com.apes.auto.car.model.Manufacturers;
import com.apes.auto.car.model.VehicleType;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @ClassName OilSpecification
 * @Description 油品规格
 * @Author pengyb
 * @Date 2019/8/8 16:34
 * @Version 1.0
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = OilSpecification.CONST_TABLE_NAME)
public class OilSpecification implements ApesBean {
    public static final String CONST_TABLE_NAME = "zq_ycwy";
    @Id
    @Column(name = "levelID", length = 32)
    @Comment("levelID")
    private String levelID;

    @Column(name = "CXID", length = 32)
    @Comment("车型ID")
    private String CXID;

    @NotNull
    @Comment("品牌")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PP", referencedColumnName = "id")
    private CarBrand PP;

    @NotNull
    @Comment("厂商")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CS", referencedColumnName = "id")
    private Manufacturers CS;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CX", referencedColumnName = "id")
    @Comment("车型")
    private VehicleType CX;


    @Column(name = "NK", length = 4)
    @Comment("年款")
    private Integer NK;

    @Column(name = "PL", length = 16)
    @Comment("排量")
    private String PL;


    @Column(name = "RLLX", length = 16)
    @Comment("燃料类型")
    private String RLLX;

    @Column(name = "BSQMS", length = 200)
    @Comment("变速器描述")
    private String BSQMS;

    @Column(name = "LC", length = 16)
    @Comment("里程（公里）")
    private String LC;

    @Column(name = "SJ", length = 16)
    @Comment("时间（个月）")
    private String SJ;

    @Column(name = "JCYLX", length = 16)
    @Comment("基础油类型")
    private String JCYLX;

    @Column(name = "YPGG", length = 16)
    @Comment("油品规格")
    private String YPGG;


}
